<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02switch语句</title>
    <style>
        body{
            background: url(images/chun1.jpg) no-repeat;
        }
    </style>
    <script>
        window.onload = function(){
           var sel =  document.getElementById("sel");
           sel.onchange = function(){
               switch(this.value){
                   case "1":
                   document.body.style.backgroundImage = "url(images/chun1.jpg)";
                   break;
                   case "2":
                       document.body.style.backgroundImage = "url(images/xia1.jpg)";
                       break;
                   case "3":
                       document.body.style.backgroundImage = "url(images/qiu1.jpg)";
                       break;
                   case "4":
                       document.body.style.backgroundImage = "url(images/dong1.jpg)";
                       break;
               }
           }
        }
    </script>
</head>
<body>
<select name="" id="sel">
    <option value="1">春意盎然</option>
    <option value="2">夏日炎炎</option>
    <option value="3">秋声瑟瑟</option>
    <option value="4">冬雪皑皑</option>
</select>
</body>
</html>